#ifndef CARSIMULATION_H
#define CARSIMULATION_H

#include <QMainWindow>
#include "sendreceivecontroll.h"
#include "car.h"

namespace Ui {
    class CarSimulation;
}

class CarSimulation : public QMainWindow {
    Q_OBJECT
public:
    sendReceiveControll *brdCtl;
    sendReceiveControll *commCtl;

    CarSimulation(QWidget *parent = 0);
    ~CarSimulation();

protected:
    void changeEvent(QEvent *e);

private:
    Ui::CarSimulation *ui;

    bool simStart();
    bool simStop();
    void addCar2List(QHostAddress senderIP, int id, int weite, int spur);
    QList<Car> CarList;
    int count;
    bool laeuft;
    QTimer *timer;



signals:

public slots:
    void press_bt_start();
    void nextStep();
    void carBroadcoastReceive(QHostAddress senderIP, quint16 senderPort,QByteArray data);
    void carDataReceive(QHostAddress senderIP, quint16 senderPort,QByteArray data);
};

#endif // CARSIMULATION_H
